package com.spring.application;

import com.java.bean.Person;
import com.java.controller.BookController;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringIOCConfApp_06 {
    @Test
    public void getBean(){
        ApplicationContext context = new ClassPathXmlApplicationContext("springIOC-conf-06.xml");
        Object bookService = context.getBean("bookService");
        System.out.println(bookService);
    }

    @Test
    public void getController(){
        ApplicationContext context = new ClassPathXmlApplicationContext("springIOC-conf-06.xml");
        BookController bookController = context.getBean("bookController", BookController.class);
        bookController.doGet();
    }
}
